import numpy as np
import pandas as pd
from pandas import Series,DataFrame

data = DataFrame({'food':['bacon', 'pulled pork', 'bacon', 'Pastrami','corned beef', 'Bacon', 'pastrami', 'honey ham', 'nova lox'],
                  'ounces':[4,3,12,6,7.5,8,3,5,6]
                  })
meat_to_animal = {
    'bacon':'pig',
    'pulled pork':'pig',
    'pastrami':'cow',
    'corned beef':'cow',
    'honey ham':'pig',
    'nova lox':'salmon'
}

print data
data['animal'] = data['food'].map(str.lower).map(meat_to_animal)
print data


print "---------------------1-------------------------"

ages = [20, 22, 25, 27, 21, 23, 37, 31, 61, 45, 41, 32]
print ages

bins = [18, 25, 35, 60, 100]
cats = pd.cut(ages, bins)

print cats
print "---"
print cats.labels


